home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pasclern.zip / FORWARD.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-01  |  554b  |  26 lines

  1. PROGRAM forward_reference_example;
  2.  
  3. VAR number_of_times : INTEGER;
  4.  
  5. PROCEDURE write_a_line(VAR count : INTEGER); FORWARD;
  6.  
  7. PROCEDURE decrement(VAR index : INTEGER);
  8. BEGIN
  9.   index := index - 1;
  10.   IF index > 0 THEN
  11.     write_a_line(index);
  12. END;
  13.  
  14. PROCEDURE write_a_line;
  15. BEGIN
  16.   WRITELN('The value of the count is now ',count:4);
  17.   decrement(count);
  18. END;
  19.  
  20. BEGIN  (* main program *)
  21.   number_of_times := 7;
  22.   decrement(number_of_times);
  23.   WRITELN;
  24.   number_of_times := 7;
  25.   write_a_line(number_of_times);
  26. END.  (* of main program *)